package fr.tvbarthel.games.chasewhisply.mechanics.behaviors;

import android.util.Log;

public abstract class GameBehaviorTimeDecreasing extends GameBehaviorTime {
   private final String TAG = GameBehaviorTimeDecreasing.class.getName() ;
    @Override
    public void tick(long tickingTime) {
        Log.i(TAG,"GameBehaviorTimeDecreasing tick ") ;
        //decrease time at each tick
        final long currentTime = mGameInformation.getCurrentTime();
        final long timeAfterTick = currentTime - tickingTime;
        if (timeAfterTick > 0) {
            mGameInformation.setCurrentTime(timeAfterTick);
        } else {
            mGameInformation.setCurrentTime(0);
            mIGameBehavior.stop();
        }
    }

}
